1. Field of the Invention
The present invention generally relates to the art of digital computers, and more specifically to a Basic Input-Output System (BIOS) Read-Only Memory (ROM) including an expansion table for expanding a monochrome image into a color image.
2. Description of the Related Art
The graphic display capabilities of digital computers are constantly improving. Video modes which provide extremely high resolution and the display of hundreds of colors are now commonplace.
Older video modes such as Color Graphics Adapter (CGA) are almost obsolete. However, it is desirable to provide backward compatibility for the older modes, so that software which was written to use these modes will run on a newer computer.
There are also some applications which can benefit from running in an older, simpler graphics mode. For example, an electronic cash register in a supermarket may display only a few rows of simple text, and need nothing more than what can be provided at high speed and low complexity by a CGA text mode.
In IBM PC type computers, for example, video display services such as text display are invoked by storing input parameters in computer registers, and generating an interrupt 10h request (the letter "h" following a number indicates that it is a hexadecimal number). To maintain backward compatibility, the video display services that are invoked via interrupt 10h must be located in the computer's Basic Input-Output System (BIOS) Read-Only Memory (ROM) chip.
A video service that is commonly used is writing a bitmapped graphic text character to the video display screen in CGA mode 4 or 5. Mode 4 provides a 40 column color display with four colors. Mode 5 provides a 40 column greyscale display with 4 levels of grey.
An input text character to be written to the screen is received as an ASCII code, in which it is represented by one byte (8 binary bits). The ASCII code is used to access a bitmap table in which each character is represented by a matrix of eight scan lines, each of which consists of one byte or 8 bits.
The bitmap table includes a monochrome image of each character in which each pixel is represented by one bit, such that the pixel can appear as one of two colors (e.g. black and white). However, CGA modes 4 and 5 provide for four possible values for each pixel, such that the pixel can be one of four colors in mode 4 and one of four shades of grey in mode 5.
The color in which the character is to be displayed is selected or specified by the function which generates the interrupt and is passed to the character display routine. Various combinations involving different pallets of colors are available. However, all of the pixels of a character are displayed in the same color.
Each character in CGA mode 4 or 5 consists of eight scan lines as in the monochrome bitmapped image. However, each scan line includes one word (two bytes), with each pixel being represented by two bits. The two bit code for each pixel enables a selected one of four colors to be specified.
In order to display a bitmapped text character in CGA mode 4 or 5, the monochrome bitmap image must be expanded into a color bitmap image in which each background pixel represented by a binary "0" in the monochrome image is expanded to binary "00", and each foreground pixel represented by a binary "1" in the monochrome image is expanded to binary "01", "10", or "11" in accordance with the selected color.
European Patent No. 71725, Aug. 31, 1988, entitled "METHOD FOR SCROLLING TEXT AND GRAPHIC DATA IN SELECTED WINDOWS OF A GRAPHIC DISPLAY", to J. Bradley, teaches how to expand a monochrome bitmap image of a character into a color bitmap image one pixel at a time.
More specifically, each bit of the bitmapped image is examined individually. If the bit is "0", a "00", is stored in a corresponding location in a video display buffer for display. If the bit is "1", a "01", "10", or "11" is stored in accordance with the selected color. This procedure is undesirably slow because each bit (pixel) is expanded individually.
An improvement to the method presented by Bradley is disclosed in German Patent Application No. 4405329A1, entitled "METHOD FOR DISPLAYING TEXT ON A PC MONITOR IN THE CGA GRAPHIC MODE", published Aug. 24, 1995, to G. Paley et al. This patent teaches how to expand a scan line in a register using a sequence of shift and logical OR operations which provides a speed improvement over the Bradley system.
However, the Paley method also expands characters one pixel at a time, requires 64 program loops (8 scan lines.times.8 bits/scan line) to expand a single character, and is also undesirably slow.